package com.bean;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MainApp {
    public static void main(String[] args) {
        ApplicationContext ctx =
                new ClassPathXmlApplicationContext("beans.xml");

        Product p = ctx.getBean("product", Product.class);
        Student s = ctx.getBean("student", Student.class);

        System.out.println("从 Spring 容器获取：");
        System.out.println(p);
        System.out.println(s);
    }
}